package com.flow.component;

import com.flow.entity.MyContext;
import com.yomahub.liteflow.core.NodeComponent;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * ComponentB
 *
 * @author grl
 * @date 2024/4/17
 */
@Slf4j
@Component("b")
public class ComponentB  extends NodeComponent {
    @Override
    public void process() {
        //do your business
        MyContext context = this.getContextBean(MyContext.class);
        Object requestData = this.getRequestData();
        Integer row = context.getRow() == null ? (Integer)requestData : context.getRow();
        context.setRow(row * 2);
        String cmpData = this.getCmpData(String.class);
        log.error("组件B被执行了 {} {}",context.getRow(),cmpData);
        int a = 0;
        int d = 10/a;
    }
}
